//
//  NSString+Decode.m
//  TaurusXi
//
//  Created by xicheng on 15/12/16.
//  Copyright © 2015年 xicheng. All rights reserved.
//

#import "NSString+URLDecode.h"

@implementation NSString(URLDecode)



//URLDEcode
+(NSString *)URLDecodeString:(NSString*)encodedString

{
  //NSString *decodedString = [encodedString stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding ];
  
  NSString *decodedString  = (__bridge_transfer NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(NULL,
                                                                                                                   (__bridge CFStringRef)encodedString,
                                                                                                                   CFSTR(""),
                                                                                                                   CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding));
  return decodedString;
}

@end
